using System;
using System.IO;
using System.Text.RegularExpressions;
namespace ChatServer
{
	public class Configure
	{
		protected string filepath;
		private string iniData ="";
		public Configure (string filename)
		{

			filepath = Path.Combine(Ullity.MyPath(), filename + ".cfg");
				if(File.Exists(filepath))
				{				  
					StreamReader inidoc = new StreamReader(filepath);
					iniData = inidoc.ReadToEnd();
				    inidoc.Close();
				}
		}

		public string GetTag(String tagname){
			if(Ullity.Instr(iniData,tagname + "=")){
				var tmp = iniData.Substring(iniData.IndexOf( tagname + "=") + (tagname + "=").Length);
				return tmp.Split('\r')[0];
			}
			return "";
		}



	}
}

